package com.example.doufacedemo

import android.app.PendingIntent
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.hardware.usb.UsbDevice
import android.hardware.usb.UsbManager
import android.util.Log
import com.ocom.ocomdevicesdk.device.keybroad.KeybroadDevice
import com.ocom.ocomdevicesdk.utils.LogHelper
import com.ocom.ocomdevicesdk.utils.UsbChecker

class UsbReceriver : BroadcastReceiver() {
    override fun onReceive(context: Context?, intent: Intent?) {
//        8199, 20785


        val s = intent?.getBooleanExtra(
            UsbManager.EXTRA_PERMISSION_GRANTED, false
        )

        Log.i("ssss", "s = " + s)
        val device = intent!!.getParcelableExtra<UsbDevice>(UsbManager.EXTRA_DEVICE)

        Log.i("ssss", "pid" + device.productId + "vid = " + device.vendorId)
        val action = intent?.action
        Log.i("ssss", "action = " + action)
    }

}